package com.ruoyi.intergral.api.factory;


import com.ruoyi.common.core.domain.R;
import com.ruoyi.intergral.api.RemoteIntergralService;
import com.ruoyi.intergral.api.model.AlipayVo;
import com.ruoyi.intergral.api.model.OperateIntergralVo;
import com.ruoyi.intergral.api.model.RefundVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.Map;

/**
 * 阿里支付服务降级处理
 *
 * @author Mike
 */
@Component
public class RemoteIntergralFallbackFactory implements FallbackFactory<RemoteIntergralService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteIntergralFallbackFactory.class);

    @Override
    public RemoteIntergralService create(Throwable throwable) {
        return new RemoteIntergralService() {

            @Override
            public R<String> decrIntergral(OperateIntergralVo vo) {
                return R.fail("增加积分失败:" + throwable.getMessage());
            }
        };
    }
}
